Skip to content

feat(nimble_web_search): optional domain/recency/date filters + output_format + result cap#262

Draft
wildcard wants to merge 4 commits into
NVIDIA-AI-Blueprints:developfrom
wildcard:feat/nimble_web_search_enriched
Draft

feat(nimble_web_search): optional domain/recency/date filters + output_format + result cap#262
wildcard wants to merge 4 commits into
NVIDIA-AI-Blueprints:developfrom
wildcard:feat/nimble_web_search_enriched

Conversation

@wildcard

@wildcard wildcard commented Jun 2, 2026

Copy link
Copy Markdown

Summary

Adds optional search-refinement controls to the nimble_web_search data source:
domain include/exclude lists, recency and date-range filters, and output-format
selection, plus a hard upper bound on result count. Every new field is optional
and defaults off, so existing workflow configs are unaffected.

Stacked on #261. This builds on the base nimble_web_search data source in
#261. Its net-new change is the final commit (feat(nimble_web_search): add optional domain/recency/date filters, output_format, and result cap). Until
#261 merges, the diff here also shows #261's commits; it collapses to just the
enrichment once #261 lands. Please review #261 first. Marked draft until then.

What changed

New optional NimbleWebSearchToolConfig fields (forwarded to
NimbleSearchRetriever only when set):

  • include_domains / exclude_domains — restrict or exclude result domains.
    Both reject an empty list (min_length=1); use None (the default) to disable.
  • time_range — recency window (hour/day/week/month/year).
  • start_date / end_date — published-date range (YYYY-MM-DD or YYYY).
  • output_formatplain_text / markdown (default) / simplified_html.

Behavior:

  • max_results is now enforced as a hard upper bound. The API may return more
    than requested, so results are sliced to max_results for predictable breadth
    consistent with the other web-search data sources. The API may still return
    fewer (a property of any SERP backend), which is surfaced as-is.
  • include_answer remains intentionally unexposed.

Validation: time_range and output_format are constrained Literal[...]
enums, so invalid values are rejected at config-load. start_date / end_date
are free-form str (accepting YYYY-MM-DD or YYYY); they are forwarded to the
SDK as-is rather than format-validated in the provider, matching the
langchain-nimble contract.

Tests

  • uv run pytest sources/nimble_web_search -q → 44 passed (12 new: passthrough
    per field, enum-rejection, empty-domain-list rejection, the upper-bound-cap
    behavior, and a filter-active-with-empty-results path).
  • Co-run with a sibling provider → 58 passed (no test-name collision).
  • ruff check / ruff format --check / uv lock --check clean.

Compatibility

All new fields default to None (or the prior implicit default for
output_format), so configs that set none of them parse unchanged and the data
source is a strict superset of the base.

One intentional behavior change applies even when no new field is set: because
max_results is now a hard upper bound, a workflow that previously received
more than max_results results (the API soft-caps above the requested count)
will now receive exactly max_results. Consumers that already sliced downstream
are unaffected; the rendered <Document> block format is otherwise unchanged.

wildcard and others added 2 commits May 31, 2026 22:47
Adds a Nimble web search integration mirroring exa_web_search and
tavily_web_search. The new sources/nimble_web_search package wraps
langchain-nimble's NimbleSearchRetriever, supports NIMBLE_API_KEY via env
or config, and exposes lite/fast/deep search depths (fast is an
enterprise-tier feature that surfaces a clear error on non-enterprise
keys; lite is the default). It is wired into the workspace, deploy/Dockerfile
(with --no-deps to preserve the frozen lockfile), and scripts/setup.sh.
Includes unit tests and documentation updates across the configuration
reference, extending guides, installation, deployment, faq, and
troubleshooting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and clarify tool description

Expose `focus` as a typed Literal config (general, news, location,
shopping, geo, social) defaulting to "general", and pass it explicitly
to NimbleSearchRetriever. The upstream SDK field is an unvalidated str
defaulting to general; the Literal adds parse-time validation and makes
the general default explicit. focus is a workflow-config setting, not an
agent-chosen parameter, so general research queries cannot silently
switch to news.

Tighten the tool description the agent sees to state it is a
general-purpose web/research search. include_answer remains unexposed in
this initial integration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

…eshold)

`news` restricts results to news-publisher sources ordered by recency; it
does not apply a recency threshold, so older articles still appear — it
changes the source mix, not the time window. Recency windowing is a
separate Nimble `time_range` capability that also works with
`focus=general`. Reword the config reference, README, and field
description to remove the misleading "current events" phrasing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tput_format, and result cap

Expose the remaining langchain-nimble search surface as optional, default-off
config: include_domains / exclude_domains (min_length=1; empty list rejected),
time_range, start_date / end_date, and output_format. All forward 1:1 to
NimbleSearchRetriever and are only sent when set. Enforce max_results as a hard
upper bound (the API soft-caps and may return more) for breadth consistent with
the sibling providers. Includes unit tests for each field's passthrough, the cap,
empty-list rejection, and the filter+empty-result path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wildcard wildcard force-pushed the feat/nimble_web_search_enriched branch from 4d7c741 to 5eca447 Compare June 4, 2026 07:03
@AjayThorve

Copy link
Copy Markdown
Collaborator

see #261 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants